/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "scactbindica")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Scactbindica.findAll", query = "SELECT s FROM Scactbindica s"),
    @NamedQuery(name = "Scactbindica.findByScactbindicaid", query = "SELECT s FROM Scactbindica s WHERE s.scactbindicaid = :scactbindicaid"),
    @NamedQuery(name = "Scactbindica.findByCodigo", query = "SELECT s FROM Scactbindica s WHERE s.codigo = :codigo"),
    @NamedQuery(name = "Scactbindica.findByNombre", query = "SELECT s FROM Scactbindica s WHERE s.nombre = :nombre"),
    @NamedQuery(name = "Scactbindica.findByDescriptor", query = "SELECT s FROM Scactbindica s WHERE s.descriptor = :descriptor"),
    @NamedQuery(name = "Scactbindica.findByResponsable", query = "SELECT s FROM Scactbindica s WHERE s.responsable = :responsable"),
    @NamedQuery(name = "Scactbindica.findByFecharegistro", query = "SELECT s FROM Scactbindica s WHERE s.fecharegistro = :fecharegistro"),
    @NamedQuery(name = "Scactbindica.findByObservaciones", query = "SELECT s FROM Scactbindica s WHERE s.observaciones = :observaciones"),
    @NamedQuery(name = "Scactbindica.findByCalculoindicador", query = "SELECT s FROM Scactbindica s WHERE s.calculoindicador = :calculoindicador")})
public class Scactbindica implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "scactbindicaid")
    private Integer scactbindicaid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 12)
    @Column(name = "codigo")
    private String codigo;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "nombre")
    private String nombre;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 500)
    @Column(name = "descriptor")
    private String descriptor;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 300)
    @Column(name = "responsable")
    private String responsable;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fecharegistro")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecharegistro;
    @Size(max = 255)
    @Column(name = "observaciones")
    private String observaciones;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 700)
    @Column(name = "calculoindicador")
    private String calculoindicador;
    @JoinColumn(name = "scactbnivelid", referencedColumnName = "scactbnivelid")
    @ManyToOne(optional = false)
    private Scactbnivel scactbnivelid;
    @JoinColumn(name = "scactbinstruid", referencedColumnName = "scactbinstruid")
    @ManyToOne(optional = false)
    private Scactbinstru scactbinstruid;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "scactbindicaid")
    private Collection<Scactbindevi> scactbindeviCollection;

    public Scactbindica() {
    }

    public Scactbindica(Integer scactbindicaid) {
        this.scactbindicaid = scactbindicaid;
    }

    public Scactbindica(Integer scactbindicaid, String codigo, String nombre, String descriptor, String responsable, Date fecharegistro, String calculoindicador) {
        this.scactbindicaid = scactbindicaid;
        this.codigo = codigo;
        this.nombre = nombre;
        this.descriptor = descriptor;
        this.responsable = responsable;
        this.fecharegistro = fecharegistro;
        this.calculoindicador = calculoindicador;
    }

    public Integer getScactbindicaid() {
        return scactbindicaid;
    }

    public void setScactbindicaid(Integer scactbindicaid) {
        this.scactbindicaid = scactbindicaid;
    }

    public String getCodigo() {
        return codigo;
    }

    public void setCodigo(String codigo) {
        this.codigo = codigo;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getDescriptor() {
        return descriptor;
    }

    public void setDescriptor(String descriptor) {
        this.descriptor = descriptor;
    }

    public String getResponsable() {
        return responsable;
    }

    public void setResponsable(String responsable) {
        this.responsable = responsable;
    }

    public Date getFecharegistro() {
        return fecharegistro;
    }

    public void setFecharegistro(Date fecharegistro) {
        this.fecharegistro = fecharegistro;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }

    public String getCalculoindicador() {
        return calculoindicador;
    }

    public void setCalculoindicador(String calculoindicador) {
        this.calculoindicador = calculoindicador;
    }

    public Scactbnivel getScactbnivelid() {
        return scactbnivelid;
    }

    public void setScactbnivelid(Scactbnivel scactbnivelid) {
        this.scactbnivelid = scactbnivelid;
    }

    public Scactbinstru getScactbinstruid() {
        return scactbinstruid;
    }

    public void setScactbinstruid(Scactbinstru scactbinstruid) {
        this.scactbinstruid = scactbinstruid;
    }

    @XmlTransient
    public Collection<Scactbindevi> getScactbindeviCollection() {
        return scactbindeviCollection;
    }

    public void setScactbindeviCollection(Collection<Scactbindevi> scactbindeviCollection) {
        this.scactbindeviCollection = scactbindeviCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (scactbindicaid != null ? scactbindicaid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Scactbindica)) {
            return false;
        }
        Scactbindica other = (Scactbindica) object;
        if ((this.scactbindicaid == null && other.scactbindicaid != null) || (this.scactbindicaid != null && !this.scactbindicaid.equals(other.scactbindicaid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Scactbindica[ scactbindicaid=" + scactbindicaid + " ]";
    }
    
}
